let href = location.href;//截取URL地址区分是否带项目路径
let cutTag ='api';
export function setBaseUrl(state) {
    console.log("href: ",href);
    
    let apiUrl = '';
    if (process.env.NODE_ENV == 'production') {
        let localHref = href.substring(0, href.indexOf(cutTag));
        apiUrl = process.env.baseUrl == '' ? "https://zhuxiongfeng.cn" : process.env.baseUrl;//判断是否分离部署
        console.log("api1",apiUrl);
    }else{
        let localHref = href.substring(0, href.indexOf(cutTag));
        apiUrl = process.env.baseUrl == '' ? localHref : process.env.baseUrl;//判断是否分离部署
    }
    console.log("api2",apiUrl);
    return apiUrl;
};